#include "window.h"

#include <QGridLayout>

#include "gamewindow.h"

using namespace cv;
using namespace mlgesture;

QGridLayout *Window::layout = NULL;
MenuState* Window::menu_ = NULL;
GameState* Window::gameState_ = NULL;
InstructionState* Window::instructionState_ = NULL;

Window::Window(QWidget *parent) :
	QWidget(parent)
{
	layout = new QGridLayout();
	setLayout(layout);
	setWindowTitle(tr("Hand Plane"));
	menu_ = new MenuState();
	gameState_ = new GameState();
	instructionState_ = new InstructionState();
	StateManager::getInstance().registerState("menu", menu_);
	StateManager::getInstance().registerState("game", gameState_);
	StateManager::getInstance().registerState("instruction", instructionState_);
	StateManager::getInstance().setState("menu");
}

Window::~Window() {
	delete layout;
}

void Window::process() {}

void Window::renderWindows() {}

QGridLayout* Window::getLayout() {
	return layout;
}

MenuState* Window::getMenuState() {
	return menu_;
}

GameState* Window::getGameState() {
	return gameState_;
}

InstructionState* Window::getInstructionState() {
	return instructionState_;
}
